Action hook 'rest_insert_{$this->post_type}'

in WP Core File wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php at line 714

Description

Fires after a single post is created or updated via the REST API. The dynamic portion of the hook name, `$this->post_type`, refers to the post type slug. Possible hook names include: - `rest_insert_post` - `rest_insert_page` - `rest_insert_attachment`

Occurrences

Filename Line Number
wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php 714
wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php 900

Parameters

Type Name Description
WP_Post $post Inserted or updated post object.
WP_REST_Request $request Request object.
bool $creating True when creating a post, false when updating.

PHP Doc

/**
		 * Fires after a single post is created or updated via the REST API.
		 *
		 * The dynamic portion of the hook name, `$this->post_type`, refers to the post type slug.
		 *
		 * Possible hook names include:
		 *
		 *  - `rest_insert_post`
		 *  - `rest_insert_page`
		 *  - `rest_insert_attachment`
		 *
		 * @since 4.7.0
		 *
		 * @param WP_Post         $post     Inserted or updated post object.
		 * @param WP_REST_Request $request  Request object.
		 * @param bool            $creating True when creating a post, false when updating.
		 */